package com.youthHostel.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.youthHostel.dao.HouseDao;
import com.youthHostel.dao.LeaseContractDao;
import com.youthHostel.dao.LesseeDao;
import com.youthHostel.pojo.house;
import com.youthHostel.pojo.leasecontract;
import com.youthHostel.pojo.lessee;
import com.youthHostel.service.LeaseContractService;

@Service
public class LeaseContractServiceImpl implements LeaseContractService{

	@Autowired
	private LeaseContractDao leaseContractDao;
	
	@Override
	public int addLc(leasecontract leaseContract) {
		return leaseContractDao.insertLc(leaseContract);
	}


	@Override
	public PageInfo<leasecontract> findAllLc(int index) {
		PageHelper.startPage(index, 3);
		List<leasecontract> queryHouseList = leaseContractDao.querylcList();
		return new PageInfo<>(queryHouseList);
	}


	@Override
	public int removeLcById(int id) {
		return leaseContractDao.deleteLcById(id);
	}


	@Override
	public leasecontract findLcMesById(int id) {
		return leaseContractDao.queryLcMesById(id);
	}


	@Override
	public int updateLc(leasecontract leaseContract) {
		return leaseContractDao.updateLcMes(leaseContract);
	}

}
